/**
 * Created by Jie on 2017/2/6.
 */
var express = require('express');
var router = express.Router();


var controller = require('../controller/core/roleController');
var rfm = require('../controller/core/rfmController');

router.get('/',controller.index);
router.get('/get/:id',controller.one);
router.get('/del/:id',controller.del);
router.get('/all',controller.all);
router.get('/form/:id',controller.form);
router.get('/rfm/:roleId',rfm.index);

router.post('/list',controller.list);
router.post('/opt/:id',function (req,res) {
    if(req.params.id==0){
        controller.insert(req,res);
    }else {
        controller.edit(req,res);
    }
});
router.post('/auth/:id',rfm.auth);

module.exports = router;